import { lazy, type JSX } from "react";
import {
  MenuFoldOutlined,
  MenuUnfoldOutlined,
  UploadOutlined,
  UserOutlined,
  VideoCameraOutlined,
} from '@ant-design/icons';
import { createBrowserRouter } from 'react-router-dom'

const App = lazy(() => import('@/App'))
const Detail = lazy(() => import('@/promise/Detail'))
const Home = lazy(() => import('@/promise/Home'))
const Login = lazy(() => import('@/promise/Login'))
const My = lazy(() => import('@/promise/My'))

type homerouter = {
    path: string;
    element: JSX.Element;
    children?: homerouter;
    icon?: any;
    label?: string;
}[]

export const tabbars:homerouter = [
    {
        path: '/detail',
        element: <Detail />,
        icon: <MenuFoldOutlined />,
        label :'详情'
    },
    {
        path: '/home',
        element: <Home />,
        icon: <MenuUnfoldOutlined />,
        label:'首页'
    },
    {
        path: '/my',
        element: <My />,
        icon: <UploadOutlined />,
         label:'我的'
    },
]

const routes:homerouter = [
    {
        path: '/',
        element: <App />,
        children:tabbars
    },
    {
        path: '/login',
        element:<Login/>
    }
]
const router = createBrowserRouter(routes)
export default router